package com.workflow.sdk.infra.util;

import java.util.regex.Pattern;

public class NumberUtil {


    /**
     * 正整数
     */
    private final static Pattern pattern = Pattern.compile("^[0-9]*[1-9][0-9]*$");

    /**
     * Is positive int boolean 判断是不是正整数
     *
     * @param str str
     * @return the boolean
     */
    public static boolean isPositiveInt(String str) {
        if (null == str) {
            return false;
        }
        return pattern.matcher(str).matches();
    }

    public static void main(String[] args) {
        System.out.println(NumberUtil.isPositiveInt("-111"));
        System.out.println(NumberUtil.isPositiveInt("s111"));
        System.out.println(NumberUtil.isPositiveInt("1s11"));
    }
}
